home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The PC-SIG Library 10
/
The PC-Sig Library - Shareware for the IBM PC and Compatibles (PC-SIG)(Tenth Edition Disks 1-2804)(1991).iso
/
PC_SIGCD
/
01
/
3
/
DISK0130.ZIP
/
TRANSLIT.MAN
< prev
next >
Wrap
Text File
|
1983-09-07
|
2KB
|
78 lines
.im man.im
.NM translit transliterate characters
.SY translit [^]src [dest]
.FU
.ital translit
maps its input, on a character by character basis, and writes the
translated version to its output.
In the simplest case, each character in the argument
.ital src
is translated to the corresponding character in the argument
.ital dest;
all other characters are copied as is.
Both
.ital src
and
.ital dest
may contain substrings of the form
.bold c1-c2
as shorthand for all of the characters in the range
.bold c1..c2.
.bold c1
and
.bold c2
must both be digits, or both be letters of the same case.
If
.ital dest
is absent, all characters represented by
.ital src
are deleted.
Otherwise, if
.ital dest
is shorter than
.ital src,
all characters in
.ital src
that would map to or beyond the last character in
.ital dest
are mapped to the last character in
.ital dest;
moreover adjacent instances of such characters in the input are
represented in the output by a single instance of the last character in
.ital dest.
Thus
.Q1
translit 0-9 9
.Q2
converts each string of digits to the single digit
.ital 9.
Finally, if
.ital src
is preceded by a
.ital ^,
then
.sf 6
all but
.sf 0
the characters represented by
.ital src
are taken as the source string;
i.e., they are all deleted if
.ital dest
is absent, or they are all collapsed if the last character in
.ital dest
is present.
.EG
To convert upper case to lower:
.Q1
translit A-Z a-z
.Q2
To discard punctuation and isolate words by spaces on each line:
.Q1
translit ^a-zA-Z\@n " "
This is a simple-minded test, i.e., a test of translit.
.ital "This is a simple minded test i e a test of translit"
.Q2